<%@ page language="java" isELIgnored="false" import="java.util.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    
<%@ taglib prefix="stripes"
	uri="http://stripes.sourceforge.net/stripes.tld"%>
	
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBliC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
<title>账单打印</title>
<script type="text/javascript">
     $(function () {
		  $("img").each(function() {
			if(this.id =='sr6'){
				var ss = "/activiti/actions/Image.action?sign=6&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}
			if(this.id=='sr1'){
				var ss = "/activiti/actions/Image.action?sign=1&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}

			if(this.id=='sr2'){
				var ss = "/activiti/actions/Image.action?sign=2&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}

			if(this.id=='sr3'){
				var ss = "/activiti/actions/Image.action?sign=3&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}

			if(this.id=='sr4'){
				var ss = "/activiti/actions/Image.action?sign=4&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}

			if(this.id=='sr5'){
				var ss = "/activiti/actions/Image.action?sign=5&&time="+new Date().getTime()+"&&fid="+'${actionBean.fid}';
				$(this).attr("src",ss);
			}

			});
	  });
</script>

<style > 
<!-- 
#news {
	font-size: 10px;
	line-height: 180%;
	font-family: Arial;
}
.title {
	font-size: 16px;
    font-weight:bold;
    
}
.title2 {
	font-size: 13px;
    font-weight:bold;
    
}
.tbw{
	  width:15%;
	}
	
.w3cbbs { page-break-after:always;}
--> 
</style>
<style  media=print> 
<!-- 
.noprint{visibility:hidden}   
--> 
</style>
</head>
<body>
<div id="news">
  <!-------------------------------------------------------主体部分 ------------------------------------------------ -->

<table border=1 width="800" style="border-collapse:collapse;" align="center" cellpadding=3 id="stabDetail">
    <tr>
        <td align="center"  colspan="7" class="title" height="30">新星公司费用报销单 </td>
    </tr>
    <tr >
       <td  colspan="7" bgcolor="#CCCCCC">
	       <table border=0 width="800" style="border-collapse:collapse;" align="center" cellpadding=3 id="stssabDetail" height="20" class="title2">
	            <tr>
			        <td align="left" width="20%">基本信息</td>
			        <td align="right" ></td>
			        <td align="right" >报账时间：<fmt:formatDate value="${actionBean.printInfo.fLoanDate}" type="date"/></td>
			        <td align="right" ></td>
			        <td align="right" >NO：${actionBean.printInfo.fNO}</td>
		        </tr>
	        </table>
        </td>
    </tr>
    <tr >
        <td align="center" class="tbw">报销部门</td>
        <td align="left" >${actionBean.printInfo.fLoanDeptName}</td>
        <td align="center" class="tbw">报销人</td>
        <td align="left"  >${actionBean.printInfo.fLoanPsnName}</td>
        <td align="center" class="tbw">报销类型</td>
        <td align="left" colspan="2">${actionBean.printInfo.fOutType}</td>
    </tr>
    <tr >
        <td align="center" class="tbw">报销事由</td>
        <td  colspan="6">${actionBean.printInfo.FREIEVENTSTR}</td>
    </tr>
    <tr >
        <td align="center" class="tbw">出差类型</td>
        <td align="left">${actionBean.printInfo.fEvectionType}</td>
        <td align="center" class="tbw">医院名称</td>
        <td align="left">${actionBean.printInfo.FEXTENDSTR2}</td>
        <td align="center" class="tbw">合同编号</td>
        <td align="left">${actionBean.printInfo.FEXTENDSTR3}</td>
    </tr>
     <tr >
        <td align="center" class="tbw">开始时间</td>
        <td align="left"><fmt:formatDate value="${actionBean.printInfo.FREIBEGINDATE}" type="date"/></td>
        <td align="center" class="tbw">结束日期</td>
        <td align="left"><fmt:formatDate value="${actionBean.printInfo.FREIBACKDATE}" type="date"/></td>
        <td align="center" class="tbw">出差天數</td>
        <td align="left" colspan="2">${actionBean.printInfo.fEXTENDNUM1}</td>
    </tr>
    <tr >
        <td align="center"class="tbw">基本补助金额</td>
        <td align="right">${actionBean.printInfo.FBASICAMT}</td>
        <td align="center"class="tbw">餐费补助金额</td>
        <td align="right">${actionBean.printInfo.FMEALSAMT}</td>
        <td align="center" class="tbw">补助金额合计</td>
        <td align="right" colspan="2">${actionBean.printInfo.FREIALLOWANCE}</td>
    </tr>
        <tr >
        <td align="center" class="tbw">原借款金额</td>
        <td align="right" >${actionBean.printInfo.FLOANAMT}</td>
        <td align="center" class="tbw">应报金额</td>
        <td align="right"  >${actionBean.printInfo.FREIMAMT}</td>
        <td align="center" class="tbw">成本类型</td>
        <td align="left" colspan="2">${actionBean.printInfo.FEXTENDSTR4}</td>
    </tr>
    <tr >
        <td align="center" class="tbw">实报金额</td>
        <td align="right">${actionBean.printInfo.FMUSTREIMAMT}</td>
        <td align="center" class="tbw">金额大写</td>
        <td  align="left" colspan="4">${actionBean.printInfo.FOUGHTREIMBAMTCN}</td>
    </tr>
    <tr >
        <td align="center" class="tbw">报账人</td>
        <td align="left"><img id="sr6"  width="23" height="23"/></td>
        <td align="center" class="tbw">主&nbsp;&nbsp;管</td>
        <td align="left"><img  id="sr1" width="23" height="23"/></td>
        <td align="center" class="tbw">核算会计</td>
        <td align="left" colspan="2"><img id="sr2" width="23" height="23"/></td>
    </tr>
     <tr >
        <td align="center" class="tbw">出&nbsp;&nbsp;纳</td>
        <td align="left"><img id="sr3" width="23" height="23"/></td>
        <td align="center" class="tbw">财务总监</td>
        <td align="left"><img id="sr4"  width="23" height="23"/></td>
        <td align="center" class="tbw">收款人</td>
        <td align="left" colspan="2"><imgid="sr5" width="23" height="23"/></td>
    </tr>
</table>
<div class="w3cbbs"></div>
  <!------------------------------------------------------- 明细部分 ------------------------------------------------ -->

<table border=1 width="800" style="border-collapse:collapse;" align="center" cellpadding=3 id="stabDetail">
    <tr>
        <td align="center"  colspan="7"  class="title" height="30">新星公司费用报销单</td>
    </tr>
    <tr >
       <td  colspan="7" bgcolor="#CCCCCC">
	       <table border=0 width="800" style="border-collapse:collapse;" align="center" cellpadding=3 id="stssabDetail" class="title2">
	            <tr>
			        <td align="left" width="20%">基本信息</td>
			        <td align="right" ></td>
			        <td align="right" >报账时间：<fmt:formatDate value="${actionBean.printInfo.fLoanDate}" type="date"/></td>
			        <td align="right" ></td>
			        <td align="right" >NO：${actionBean.printInfo.fNO}</td>
		        </tr>
	        </table>
        </td>
    </tr>
    </table>
    <table border=1 width="808" style="border-collapse:collapse;" align=center cellpadding=3 id="swtabDetail">
	        <tr>
				<td align="center" width="30">序号</td> 
				<td align="center">费用类别</td> 
				<td align="center">费用明细</td> 
				<td align="center">开始时间</td> 
				<td align="center">结束时间</td> 
				<td align="center" width="50">单据数</td> 
				<td align="center" width="70">金额（元）</td> 
				<td align="center">简要说明</td> 
		    </tr> 
			 <c:forEach var="row" items="${actionBean.result.rows}">
						  <c:choose>
						     <c:when test="${actionBean.result.rowCount >=8 && row.id%8 == 0}">
							    	<tr> 
										<td align="center">${row.id}</td> 
										<td align="left">${row.FCOSTTYPENAME}</td> 
										<td align="left">${row.FCOSTTYPESONNAME}</td> 
										<td align="center"><fmt:formatDate value="${row.FBEGINTIME}" type="date"/></td> 
										<td align="center"><fmt:formatDate value="${row.FENDTIME}" type="date"/></td> 
										<td align="right">${row.FCOSTBILLNUM}</td> 
										<td align="center">${row.FCOSTAMT}</td> 
										<td height="20">${row.fSimpleDeclara}</td> 
									</tr>
									</table>
									<div class="w3cbbs"></div>
									<table border=1 width="808" style="border-collapse:collapse;" align="center" cellpadding=3 id="stabDetail" class="title2">
									    <tr>
									        <td align="center"  colspan="7" class="title" height="30">新星公司费用报销单</td>
									    </tr>
									    <tr >
									       <td  colspan="7" bgcolor="#CCCCCC">
										       <table border=0 width="800" style="border-collapse:collapse;" align="center" cellpadding=3 id="stssabDetail">
										            <tr>
												        <td align="left" width="30%">基本信息</td>
												        <td align="right" ></td>
												        <td align="right" >报账时间：<fmt:formatDate value="${actionBean.printInfo.fLoanDate}" type="date"/></td>
												        <td align="right" ></td>
												        <td align="right" >NO：${actionBean.printInfo.fNO}</td>
											        </tr>
										        </table>
									        </td>
									    </tr>
									    </table>
									    <table border=1 width="808" style="border-collapse:collapse;" align=center cellpadding=3 id="swtabDetail">
										        <tr>
													<td align="center" width="30">序号</td> 
													<td align="center">费用类别</td> 
													<td align="center">费用明细</td> 
													<td align="center">开始时间</td> 
													<td align="center">结束时间</td> 
													<td align="center" width="50">单据数</td> 
													<td align="center" width="70">金额（元）</td> 
													<td align="center">简要说明</td> 
											    </tr> 
								 </c:when>
							    <c:when test="${actionBean.result.rowCount >=8 && row.id%8 != 0}">
									<tr> 
										<td align="center">${row.id}</td> 
										<td align="left">${row.FCOSTTYPENAME}</td> 
										<td align="left">${row.FCOSTTYPESONNAME}</td> 
										<td align="center"><fmt:formatDate value="${row.FBEGINTIME}" type="date"/></td> 
										<td align="center"><fmt:formatDate value="${row.FENDTIME}" type="date"/></td> 
										<td align="right">${row.FCOSTBILLNUM}</td> 
										<td align="center">${row.FCOSTAMT}</td> 
										<td height="20">${row.fSimpleDeclara}</td> 
									</tr>
						      </c:when>
						     <c:otherwise>
						        	 <tr> 
										<td align="center">${row.id}</td> 
										<td align="left">${row.FCOSTTYPENAME}</td> 
										<td align="left">${row.FCOSTTYPESONNAME}</td> 
										<td align="center"><fmt:formatDate value="${row.FBEGINTIME}" type="date"/></td> 
										<td align="center"><fmt:formatDate value="${row.FENDTIME}" type="date"/></td> 
										<td align="right">${row.FCOSTBILLNUM}</td> 
										<td align="center">${row.FCOSTAMT}</td> 
										<td height="20">${row.fSimpleDeclara}</td> 
									</tr>
						     </c:otherwise>
						  </c:choose>
				</c:forEach>
				<c:choose>
				  	 <c:when test="${actionBean.result.rowCount%8!=0 }">
				  	 				<c:forEach var="i" begin="1" end="${8-actionBean.result.rowCount%8}" step="1">
				  	 				 <tr> 
										<td align="center">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="center">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="center">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="right">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td align="center">&nbsp;&nbsp;&nbsp;&nbsp;</td> 
										<td>&nbsp;&nbsp;&nbsp;&nbsp;</td> 
									</tr>
									</c:forEach>
                     </c:when>
				</c:choose>
				<tr> 

										<td align="right" colspan="7">合计：</td> 
										<td align="right">${actionBean.printInfo.FFACTAMOUNT}</td> 
										</tr>
  </table>
</div>
<!--<div align="center" class="noprint"><button name="打印" value="打印" width="30" onclick="printme()">打印</button></div>  -->		

	
</body>
</html>